Field of the Invention
The present invention relates to an information processing apparatus and a method of controlling the same, and a non-transitory computer-readable medium.
Description of the Related Art
Conventionally, in information processing apparatuses such as PCs, in processing for executing multiple tasks using multithreading, when enqueuing tasks into a queue associated with a thread, control is performed to make the processing of the respective threads equal based on the length of the queue, task execution time, or the like. By this, task execution is performed efficiently (for example, refer to Japanese Patent Laid-Open No. 2013-54451).
However, with the foregoing conventional technique there is a problem in that even in the case where a degree of priority of a task is high (when it is desired to be executed urgently), since the task is enqueued at the end of the queue, the task whose degree of priority is high will not be executed so long as tasks whose degree of priority is low which were enqueued first do not complete. Also, even if there is an empty queue and a thread associated with the empty queue is in an idle state, tasks accumulated in a queue other than the empty queue will not be executed until they are enqueued by the thread associated with the other queue. As a result, operation becomes inefficient.